/******************************************************************************\
    Additions.h contains classes for various page additions like pictures,
    javascripts etc.
    It's used with acm server plugins. See DllMain.cpp for details.
    Copyright (C) 2008  Victor Vinogradov (fly3333@gmail.com)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
\******************************************************************************/

#pragma once 

#include <string>
#include <vector>
#include <Common\CriticalSection.hpp>

struct sAddition
{
	std::string Name;
	std::string Data;
	sAddition( const std::string &name, const std::string &data )
		: Name( name )
		, Data( data )
	{
	}
	sAddition( const sAddition &addition )
		: Name( addition.Name )
		, Data( addition.Data )
	{
	}
	sAddition &operator =( const sAddition &addition )
	{
		Name = addition.Name;
		Data = addition.Data;
		return *this;
	}
};

extern cCriticalSection AdditionsCriticalSection;

extern std::vector< sAddition > Addition;

bool LoadAdditions( const std::string &path, std::string &html_page, std::vector< unsigned long > &addition_id );
